﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Common;
using Objects;

namespace AutoFix.ClientComponents
{
    public class AppSession : System.Web.UI.Page
    {
        #region [Constructor]

        /// <summary>
        /// Initializes a new instance of the <see cref="AppSession"/> class.
        /// </summary>
        public AppSession() { }

        #endregion

        #region [Public Properties]

        /// <summary>
        /// Gets or sets the application user.
        /// </summary>
        /// <value>
        /// The application user.
        /// </value>
        public User ApplicationUser
        {
            get { return (this.Session[Constants.WebApp.Session.ApplicationUser] != null) ? (this.Session[Constants.WebApp.Session.ApplicationUser] as Objects.User) : null; }
            set { this.Session[Constants.WebApp.Session.ApplicationUser] = value; }
        }
        /// <summary>
        /// Gets or sets the article created.
        /// </summary>
        /// <value>
        /// The article
        /// </value>
        public Article Article
        {
            get { return (this.Session[Constants.WebApp.Session.Article] != null) ? (this.Session[Constants.WebApp.Session.Article] as Objects.Article) : null; }
            set { this.Session[Constants.WebApp.Session.Article] = value; }
        }

        #endregion
    }
}